package com.hust.ele.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hust.ele.bean.User;
import com.hust.ele.cache.UserCache;
import com.hust.ele.dao.UserDao;
import com.hust.ele.service.UserService;

@Service(value="userService")
public class UserServiceImpl implements UserService {
	@Autowired
	UserDao userdao;
	@Autowired
	UserCache userCache;
	
	@Override
	public User findUserByLoginName(String loginName) {
		return this.userCache.findUserByLoginName(loginName);
	}

	@Override
	public void saveUser(User user) {
		this.userdao.save(user);	
	}

}
